#ifndef JOURNEYMODELS_H
#define JOURNEYMODELS_H

#include <QString>
#include <QTime>
#include <QList>

class FlightSegment {
public:
    QString fromCity;
    QString toCity;
    QString airline;
    QString flightNumber;
    QString departureAirport;
    QString arrivalAirport;
    QTime departureTime;
    QTime arrivalTime;
    QTime totalTime;
    double price;
    bool isTransfer;  // 是否是转机航班

    FlightSegment() : price(0.0),  isTransfer(false) {}
};


class FlightJourney {
public:
    QString startCity;
    QString endCity;
    QList<FlightSegment> segments; // 旅程中的所有航班段
    double totalPrice ;             // 旅程的总价格
    int totalMinutes;

    int hour;
    int minute;

    FlightJourney() : totalPrice(0.0) {}
    int getTotalTime() const;
    int getTotalMinutes(int t) const;
    int getTotalHours(int t) const;
    double getTotalPrice() const;

};

#endif // JOURNEYMODELS_H
